package com.sms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sms.mapper.PromotionsTypeMapper;
import com.sms.pojo.PromotionsType;
import com.sms.service.PromotionsTypeService;
import com.sms.util.SqlSessionFactoryUtil;
import lombok.Getter;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import java.util.List;
@Getter
public class PromotionsTypeServiceImpl extends ServiceImpl<PromotionsTypeMapper, PromotionsType> implements PromotionsTypeService {

    SqlSession sqlSession=null;

    @Override
    public PromotionsTypeMapper getBaseMapper() {
        SqlSessionFactory factory = SqlSessionFactoryUtil.getFactory();
        sqlSession=factory.openSession(true);
        PromotionsTypeMapper mapper = factory.getConfiguration().getMapper(PromotionsTypeMapper.class, sqlSession);
        return mapper;
    }

    @Override
    public List<PromotionsType> listPromotionsType() {
        return this.getBaseMapper().listPromotionsType();
    }
}
